/**
 * Created by Dalyn on 2017/3/24.
 */
import Relay from "react-relay";

export default class ApplyLoanMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { applyLoan }`;
    }

    getVariables() {
        return {
            argsInput: {
                loanMoney : this.props.loanMoney ,
                orderId: this.props.orderId,
                orderMoney: this.props.orderMoney,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on applyLoanPayload {
            data {  
                errorCode
                value
                totalResult
                id
                loanInfoDomain{
                    dayRate
                }
              
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
                fragment on applyLoanPayload {
                    data {
                        errorCode
                        value
                        totalResult
                        id
                        loanInfoDomain{
                            dayRate
                        }
                    }
                }
            `]
        }];
    }

}
